import React, {Component} from 'react';
import {Platform, StyleSheet, Text, View, Image, 
  Dimensions,ScrollView,WebView,Button,
  TouchableOpacity,Modal,TextInput,StatusBar
} from 'react-native';
import Toast, {DURATION} from 'react-native-easy-toast';
import Orientation from 'react-native-orientation';
import MyButton from '../../component/MyButton';
let {height, width} = Dimensions.get('window');
export default class TempEdit extends Component{
  static navigationOptions = ({ navigation }) =>{
    return{
      // title:navigation.getParam('tempTitle'),
      // headerRight:(<View></View>),
      // headerLeft:<BackButton navigation = {navigation}/>
      header: null,
    }
  };
  componentWillMount() {
    Orientation.lockToLandscape();
    //this.getData(1);
    //this._getDetail(1);
    
  }
  componentWillUnmount() {
    Orientation.lockToPortrait();
  }
  _textChange(val){

  }
  render(){
    return(
      <View style={styles.mView}>
        <View style={[styles.lView]}>
          <View style={{
            borderColor:'#888',
            borderTopWidth:StyleSheet.hairlineWidth,
            borderBottomWidth:StyleSheet.hairlineWidth,
          }}>
            <TextInput 
              ref={this.props._ref}
              placeholder='请输入文字'
              style={styles.searchInput}
              underlineColorAndroid="transparent"
              onChangeText={(val)=>this._textChange(val)}
              returnKeyType='done'
              placeholderTextColor='#aaa'
            />
          </View>
          
          <MyButton text='确定' press={()=>this._saveText()} 
          btnStyle={{marginLeft:1,marginRight:1,marginTop:0,
            paddingLeft:10,paddingRight:10,
          marginBottom:1,borderRadius:5,}}/>
        </View>
      </View>
    )
  }
}
const styles = StyleSheet.create({
  searchInput:{
    marginLeft:15,
    padding:0,
    flex:1,
    height: 46, 
    fontSize:15,
    width:height/3,
  },
  lView:{
    backgroundColor:'white',
    opacity:1,
    borderRadius:5,
    padding:10,
    justifyContent:'center',
    alignItems:'center',
    flexDirection:'row',
    width:height/2,
  },
  mView:{
    flex:1,
    borderWidth:1,
    //opacity:0.5,
    //justifyContent:'center',
    marginTop:20,
    alignItems:'center',
    backgroundColor:'rgba(0, 0, 0, 0.5)',
  },

})